<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./layui/css/layui.css">
</head>
<body>
  <div id="rate"></div>
  <script src="./layui/layui.js"></script>
  <script>
    layui.use(['jquery', 'rate'], function(){
      // 模块引入成功后触发 所有代码需要在这里写
      var $ = layui.jquery;
      var rate = layui.rate;
      //渲染
      var ins1 = rate.render({
        elem: '#rate'  //绑定元素
      });
    })
  </script>
</body>
</html>